import { ForbiddenError, useHasura } from "@sker/core"
import { useCurrentMember, useData } from "@sker/runtime"
import { z } from "zod"
const schema = z.object({
    query: z.string(),
    variables: z.optional(z.any()),
})
export default async () => {
    const [current] = await useCurrentMember()
    // current log
    const body = schema.parse(useData())
    const res = await useHasura({
        query: body.query,
        variables: body.variables
    })
    return res
}
